this.BX=this.BX||{};(function(e,t,n,r){"use strict";function i(e,t){var n=e.replace(/@[1-9]x/,"");return n?n.replace(/\.[^.]+$/,"@".concat(t,"x.").concat(BX.util.getExtension(n))):n}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a=function(){function e(t){babelHelpers.classCallCheck(this,e);this.options=s({uploadParams:{},additionalParams:{},dimensions:{},sizes:["1x"]},t)}babelHelpers.createClass(e,[{key:"setSizes",value:function e(t){this.options.sizes=t;return this}},{key:"getDimensions",value:function e(){var n=Object.entries(this.options.dimensions);return this.options.sizes.map((function(e){return Number.parseInt(e)})).filter((function(e){return t.Type.isNumber(e)})).map((function(e){return n.reduce((function(t,n){var r=babelHelpers.slicedToArray(n,2),i=r[0],o=r[1];t[i]=o*e;return t}),{})}))}},{key:"upload",value:function e(o){var a=this;var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Promise.all(this.getDimensions().map((function(e){var r=a.options.allowSvg&&t.Type.isStringFilled(o.type)&&o.type.includes("svg");if(r){return o}return n.ImageCompressor.compress(o,e)}))).then((function(e){var t=s(s(s({},a.options.uploadParams),a.options.additionalParams),c);var n=e.map((function(e,n){var o=e.name;Object.defineProperty(e,"name",{get:function e(){return i(o,n+1)},configurable:true});return r.Backend.getInstance().upload(e,t)}));return Promise.all(n)}))}}]);return e}();e.ImageUploader=a})(this.BX.Landing=this.BX.Landing||{},BX,BX.Landing,BX.Landing);
//# sourceMappingURL=imageuploader.bundle.map.js